<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="zhcms.framework.*" %> 
<%@ page import="zhcms.cms.*" %> 
<%@ page import="zhcms.tool.*" %> 
<%
//设置缓存
String url=request.getScheme()+"://"+request.getHeader("host")+request.getRequestURI();   
if(request.getQueryString()!=null) url+="?"+request.getQueryString();
GyCache gycache=new GyCache(60,url);
gycache.cacheCheck(application.getRealPath("/"));
String iscache=gycache.getCacheGetZ();
//设置输出内容
String OutContent="";
String articleid="";
	
articleid=request.getParameter("articleid");

//进行参数判断
if(GyHtmlConvertor.sql_inj(articleid)==true)
{
	out.println("<script language=javascript>alert(\"对不起，传递的参数有非法字符！\");history.go(-1);</script>");
}

if(iscache.equals("n") || iscache.equals("u"))
{
	//获取系统的模板参数
	//GyTest t=new GyTest("/template/Index.html","UTF-8");
	GyT t=new GyT();
	t.setFrontSeparator("{@#");
	t.setBackSeparator("#@}");
	t.setfilename("/template/View.html");
	
	GySystem gys=new GySystem();
	t.setInVtrParameter("SiteName", gys.getSiteName());
	t.setInVtrParameter("SiteEMail", gys.getSiteEMail());
	t.setInVtrParameter("SiteUrl", gys.getSiteUrl());
	t.setInVtrParameter("SystemVersion", gys.getSystemVersion());
	
	GyArticle gya=new GyArticle();
	gya.updateViewNum(articleid);
	//gya.setArticleid(articleid);
	gya.getArticle(articleid);

	t.setInVtrParameter("articleid", articleid);
	t.setInVtrParameter("ColumnId", gya.getColumnId());
	t.setInVtrParameter("ColumnName", gya.getColumnName());
	t.setInVtrParameter("Title", gya.getTitle());
	t.setInVtrParameter("AddDate", gya.getAddDate());
	t.setInVtrParameter("Content", gya.getContent());
	t.setInVtrParameter("KeyWord", gya.getKeyWord());
	t.setInVtrParameter("FromName", gya.getFromName());
	t.setInVtrParameter("ViewNum", gya.getViewNum());
	t.setInVtrParameter("Author", gya.getAuthor());
	t.setInVtrParameter("TColor", gya.getTColor());
	t.setInVtrParameter("IsImg", gya.getIsImg());
	t.setInVtrParameter("Img", gya.getImg());
	t.setInVtrParameter("FirstArticle", gya.getFirstArticle(articleid));
	t.setInVtrParameter("NextArticle", gya.getNextArticle(articleid));
	t.setInForParameter("CorrList", gya.getCorrList(articleid, "5"));
	
	ArrayList<HashMap<String, String>> P_9w2489xu;
P_9w2489xu=new ArrayList<HashMap<String, String>>();
GyTablseToList Cl_lxb0mv =new GyTablseToList();
P_9w2489xu=Cl_lxb0mv.getAllList("select Id,ColumnCode,ColumnName,AddDate,Title,ViewNum from gyhy_content where 1=1 order by ViewNum desc limit 0 , 10");
t.setInForParameter("tuijianlist", P_9w2489xu);
	
	
	t.parse("UTF-8");
	OutContent=t.Out();

	//建立缓存
	if(iscache.equals("n"))
	{
		gycache.WriteNewFile(OutContent,"UTF-8");
	}
	else if(iscache.equals("u"))
	{
		gycache.WriteUpdateFile(OutContent,"UTF-8");
	}

}
else 
{
	gycache.getContent("UTF-8");
	OutContent=gycache.getCacheReturnS();
}
out.println(OutContent);
%>